<?php
return [

    /**
     * --------------------------------------------------
     * |                  server
     * ___________________________________________________
     */
    "server" => [
        "host" => "0.0.0.0",
        "port" => 18308,
        "event" => "\\App\\events\\PrinterTcpServer",
        "delimiter" => "##x#y#c##",
    ],

    /**
     * --------------------------------------
     *  tcp服务配置
     * --------------------------------------
     */

    "tcp" => [
        "worker_num" => 4,
        "max_request" => 1000,
        "max_conn" => 500,
        "task_worker_num" => 0,
        "task_max_request" => 100,
//        "daemonize " => false,
//        "log_file" => ROOT_PATH . "/runtime/log.log",
//        'log_date_format' => '%Y-%m-%d %H:%M:%S',
        'heartbeat_idle_time' => 120,
        'heartbeat_check_interval' => 60,  // 表示每60秒遍历一次
        //分包
        'open_length_check' => true,
//        'package_max_length' => 10,
        'package_length_type' => 'N', //4个字节
        'package_length_offset' => 2,
        'package_body_offset' => 6,
        'pid_file' => ROOT_PATH . '/runtime/server.pid',
        'hook_flags' => SWOOLE_HOOK_SLEEP,
        'reload_async' => true,
        'max_wait_time' => 60,
//        "open_http_protocol" => true,
    ],


    /**
     * --------------------------------------------------
     * |                  redis
     * ___________________________________________________
     */

    "redis" => [
        "host" => "127.0.0.1",
        "port" => 6379,
        "auth" => "lsk9118",
        "index" => 1,
        "max" => 10,
    ],


];